<template>
  <div>
    <div class="hr-8"></div>
    <div class="guessYourLike">猜你喜欢</div>
    <div class="yourLikeList">
      <div
        class="yourLikeList_good"
        v-for="(good, index) in goods"
        :key="index"
      >
        <div class="goodImgBox">
          <img :src="'../../../../../binbing/homePagePublic/yourLikeGoods' + good.img + '.webp'" />
        </div>
        <div class="goodIntroBox">
          <div class="goodIntroBox_name">
            {{ good.gname }}
          </div>
          <div class="goodIntroBox_desc">
            {{ good.desc }}
          </div>
          <div class="goodIntroBox_price">￥{{ good.gprice }}</div>
          <div class="goodIntroBox_sale">
            <span>{{ good.sale }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "GuessYourLike",
  data() {
    return {
      goods: []
    };
  },
  created() {
    axios(
      {
        url: "http://x92nyn.natappfree.cc/goods/selectAll"
      }
    ).then(
      res => {
        this.goods=res.data.data;
        console.log("this.goods",res);
      }
    ).catch((err)=>{
      console.log(err);
    })
  }
};
</script>

<style scoped>
.hr-8 {
  width: 100%;
  height: 0.08rem;
}

.guessYourLike {
  height: 0.24rem;
  padding: 0.08rem 0.16rem;
  font-size: 0.16rem;
  font-weight: 600;
}

.yourLikeList {
  display: flex;
  padding: 0 0.16rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

.yourLikeList_good {
  width: 1.87rem;
  height: 3.05rem;
  margin-top: 0.08rem;
  background-color: #fff;
  border-radius: 0.08rem;
  overflow: hidden;
}

.goodImgBox {
  width: 1.87rem;
  height: 1.87rem;
  position: relative;
}

.goodImgBox > img {
  width: 1.4rem;
  height: 1.4rem;
  display: block;
  position: absolute;
  margin: auto;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.goodIntroBox {
  width: 1.71rem;
  height: 0.98rem;
  padding: 0.08rem 0.08rem 0.12rem;
}

.goodIntroBox_name {
  width: 1.71rem;
  height: 0.36rem;
  font-size: 0.13rem;
  line-height: 0.18rem;
  font-weight: bold;
}

.goodIntroBox_desc {
  width: 1.71rem;
  height: 0.16rem;
  font-size: 0.12rem;
  opacity: 0.5;
}

.goodIntroBox_price {
  width: 1.71rem;
  height: 0.19rem;
  padding: 0.01rem 0;
  margin-top: 0.06rem;
  font-size: 0.16rem;
  color: rgb(207, 10, 44);
  font-weight: 600;
}

.goodIntroBox_sale {
  width: 1.71rem;
  height: 0.14rem;
  margin-top: 0.05rem;
}

.goodIntroBox_sale span {
  width: 0.36rem;
  height: 0.12rem;
  border: 1px solid rgba(207, 10, 44, 0.4);
  font-size: 0.09rem;
  display: block;
  color: rgb(207, 10, 44);
  border-radius: 0.04rem;
}
</style>